//package com.huai.demo_test1.controller;
//
//import com.huai.demo_test1.config.JmsConfig;
//import com.huai.demo_test1.rocketmq.ProducerTest;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.rocketmq.client.exception.MQBrokerException;
//import org.apache.rocketmq.client.exception.MQClientException;
//import org.apache.rocketmq.client.producer.SendResult;
//import org.apache.rocketmq.common.message.Message;
//import org.apache.rocketmq.remoting.exception.RemotingException;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RestController;
//
///**
// * @author 淮晓欢
// * @date 2022/1/3
// **/
//@Slf4j
//@RestController
//public class RocketMqController {
//    @Autowired
//    ProducerTest producerTest;
//
//    @GetMapping("/hello")
//    public void hello() throws InterruptedException, RemotingException, MQClientException, MQBrokerException {
//        for (int i = 0; i < 10; i++) {
//            //创建信息
//            Message message=new Message(JmsConfig.TOPIC,"testtag",("Hello World"+i).getBytes());
//            //发送
//            SendResult result = producerTest.getProducer().send(message);
//            log.info("输出生产者信息={}",result);
//        }
//    }
//
//}
